package com.cloudfun.campusshare.controller;
import com.google.common.collect.Lists;

import com.cloudfun.campusshare.common.constant.Code;
import com.cloudfun.campusshare.common.constant.ProductType;
import com.cloudfun.campusshare.common.model.dto.DeviceMetaModeDTO;
import com.cloudfun.campusshare.common.model.dto.DeviceMetaModeSearchDTO;
import com.cloudfun.campusshare.common.response.BaseResult;
import com.cloudfun.campusshare.common.response.BaseResultFactory;
import com.cloudfun.campusshare.common.security.AuthRequired;
import com.cloudfun.campusshare.service.DeviceMetaModeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Huqin on 2020/5/11
 */
@Slf4j
@RestController
@RequestMapping("/v1/deviceMetaMode")
@Api(value = "设备元模式模块", description = "设备元模式模块")
@AuthRequired
public class DeviceMetaModeController {

    @Autowired
    private DeviceMetaModeService deviceMetaModeService;

    @ApiOperation(value = "获取设备元模式", notes = "获取设备元模式")
    @GetMapping("/simpleList")
    public BaseResult<List<DeviceMetaModeDTO>> simpleList(DeviceMetaModeSearchDTO searchDTO) {
        List<DeviceMetaModeDTO> res = deviceMetaModeService.getDeviceMetaModeMap(searchDTO);
        return BaseResultFactory.produceResult(Code.SUCCESS, res);
    }

}
